package de.jmda.gen.java;

import java.lang.annotation.Annotation;

import javax.lang.model.element.Name;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.validation.constraints.NotNull;

import de.jmda.gen.java.ModifiersUtil.VisibilityModifier;

/**
 * Generator for method declarations.
 *
 * @author rwegner
 */
public interface MethodGenerator extends DeclarationGenerator
{
	DeclaredMethodGenerator getDeclaredMethodGenerator();
	void setDeclaredMethodGenerator(DeclaredMethodGenerator generator);

	void addAnnotation(@NotNull Class<? extends Annotation> annotation);
	void setVisibility(VisibilityModifier modifier);
	void setType(@NotNull Class<?> type);
	void setType(@NotNull TypeMirror type);
	void setType(@NotNull TypeElement type);
	/**
	 * use this method for primitive types only
	 * @param typename
	 */
	void setType(@NotNull String typename);
	void setTypeFrom(@NotNull VariableElement field);
	void setName(@NotNull String methodName);
	void setName(@NotNull Name methodName);
	void addParameter(@NotNull Class<?> type, @NotNull String name);
	void addParameter(@NotNull TypeMirror type, @NotNull String name);
	void addParameter(@NotNull TypeElement type, @NotNull String name);
	void addParameter(@NotNull String type, @NotNull String name);
	void addParameterFrom(@NotNull VariableElement field, @NotNull String name);
	void addParameterFrom(@NotNull VariableElement field, @NotNull Name name);
	void setMethodBody(String methodBody);
}